package lincen.javame.game.handhelddevice;


import java.awt.Color;
import java.awt.Graphics;

import lincen.javame.ui.geometric.Rect;

public class Infomation extends Rect {

	/**
	 * PointNext的行数列数
	 */
	public final static int COL = 4, ROW = 4;
	
	private int level;
	
	private int score;

	private Cells cell;
	
	public Infomation() {
		this.cell = new Cells(COL, ROW);
	}
	
	void paint(Graphics g) {
		Color colorBefor = g.getColor();
		g.setColor(Cells.CELL_COLOR);
		g.drawLine(this.getX() + 5, this.getY(), this.getX() + 5, this.getY() + this.getHeight());
//		g.fillRect(this.getX(), this.getY(), getWidth(), getHeight());
		g.drawString("level",              this.getX() + 15, this.getHeight() - 40 - g.getFont().getSize());
		g.drawString(this.getLevel() + "", this.getX() + 15, this.getHeight() - 40);
		
		g.drawString("score" + "",         this.getX() + 15, this.getHeight() - 3 - g.getFont().getSize());
		g.drawString(this.getScore() + "", this.getX() + 15, this.getHeight() - 3);
		this.cell.paint(g);
		g.setColor(colorBefor);
	}
	
	public void setLocation(int x, int y) {
		super.setLocation(x, y);
		this.cell.setX(x + Cells.CELLWIDTH + 6);
		this.cell.setY(y + Cells.CELLWIDTH);
	}
	
	public void setLevel(int level) {
		this.level = level;
	}

	public int getLevel() {
		return level;
	}

	public void setScore(int score) {
		this.score = score;
	}

	public int getScore() {
		return score;
	}

	public void open(int x, int y) {
		this.cell.open(x, y);
	}

	public void close(int x, int y) {
		this.cell.close(x, y);
	}
}
